class ListDeviceProjectBean {
  bool success;
  String message;
  int code;
  List<Result> result;
  int timestamp;

  ListDeviceProjectBean(
      {this.success, this.message, this.code, this.result, this.timestamp});

  ListDeviceProjectBean.fromJson(Map<String, dynamic> json) {
    success = json['success'];
    message = json['message'];
    code = json['code'];
    if (json['result'] != null) {
      result = new List<Result>();
      json['result'].forEach((v) {
        result.add(new Result.fromJson(v));
      });
    }
    timestamp = json['timestamp'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['success'] = this.success;
    data['message'] = this.message;
    data['code'] = this.code;
    if (this.result != null) {
      data['result'] = this.result.map((v) => v.toJson()).toList();
    }
    data['timestamp'] = this.timestamp;
    return data;
  }
}

class Result {
  String id;
  String lat;
  String lon;
  String clockInNumber;
  String clockTime;
  int checkId;
  int areaId;
  String areaName;
  String clocking;
  String clockingStr;
  String isDone;
  String doneTime;
  String isDoneStr;
  int inspectorId;
  String checkUser;
  String checkUserName;
  String doneImageUrl;
  List<CheckTaskDevices> checkTaskDevices;

  Result(
      {this.id,
        this.lat,
        this.lon,
        this.clockInNumber,
        this.clockTime,
        this.checkId,
        this.areaId,
        this.areaName,
        this.clocking,
        this.clockingStr,
        this.isDone,
        this.doneTime,
        this.isDoneStr,
        this.inspectorId,
        this.checkUser,
        this.checkUserName,
        this.doneImageUrl,
        this.checkTaskDevices});

  Result.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    lat = json['lat'];
    lon = json['lon'];
    clockInNumber = json['clockInNumber'];
    clockTime = json['clockTime'];
    checkId = json['checkId'];
    areaId = json['areaId'];
    areaName = json['areaName'];
    clocking = json['clocking'];
    clockingStr = json['clockingStr'];
    isDone = json['isDone'];
    doneTime = json['doneTime'];
    isDoneStr = json['isDoneStr'];
    inspectorId = json['inspectorId'];
    checkUser = json['checkUser'];
    checkUserName = json['checkUserName'];
    doneImageUrl = json['doneImageUrl'];
    if (json['checkTaskDevices'] != null) {
      checkTaskDevices = new List<CheckTaskDevices>();
      json['checkTaskDevices'].forEach((v) {
        checkTaskDevices.add(new CheckTaskDevices.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['lat'] = this.lat;
    data['lon'] = this.lon;
    data['clockInNumber'] = this.clockInNumber;
    data['clockTime'] = this.clockTime;
    data['checkId'] = this.checkId;
    data['areaId'] = this.areaId;
    data['areaName'] = this.areaName;
    data['clocking'] = this.clocking;
    data['clockingStr'] = this.clockingStr;
    data['isDone'] = this.isDone;
    data['doneTime'] = this.doneTime;
    data['isDoneStr'] = this.isDoneStr;
    data['inspectorId'] = this.inspectorId;
    data['checkUser'] = this.checkUser;
    data['checkUserName'] = this.checkUserName;
    data['doneImageUrl'] = this.doneImageUrl;
    if (this.checkTaskDevices != null) {
      data['checkTaskDevices'] =
          this.checkTaskDevices.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class CheckTaskDevices {
  String id;
  String checkId;
  String areaId;
  int deviceId;
  String deviceName;
  int deviceTypeId;
  String deviceCode;
  String deviceTypeName;
  String deviceLonglat;
  List<CheckTaskProjects> checkTaskProjects;

  CheckTaskDevices(
      {this.id,
        this.checkId,
        this.areaId,
        this.deviceId,
        this.deviceName,
        this.deviceTypeId,
        this.deviceCode,
        this.deviceTypeName,
        this.deviceLonglat,
        this.checkTaskProjects});

  CheckTaskDevices.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    checkId = json['checkId'];
    areaId = json['areaId'];
    deviceId = json['deviceId'];
    deviceName = json['deviceName'];
    deviceTypeId = json['deviceTypeId'];
    deviceCode = json['deviceCode'];
    deviceTypeName = json['deviceTypeName'];
    deviceLonglat = json['deviceLonglat'];
    if (json['checkTaskProjects'] != null) {
      checkTaskProjects = new List<CheckTaskProjects>();
      json['checkTaskProjects'].forEach((v) {
        checkTaskProjects.add(new CheckTaskProjects.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['checkId'] = this.checkId;
    data['areaId'] = this.areaId;
    data['deviceId'] = this.deviceId;
    data['deviceName'] = this.deviceName;
    data['deviceTypeId'] = this.deviceTypeId;
    data['deviceCode'] = this.deviceCode;
    data['deviceTypeName'] = this.deviceTypeName;
    data['deviceLonglat'] = this.deviceLonglat;
    if (this.checkTaskProjects != null) {
      data['checkTaskProjects'] =
          this.checkTaskProjects.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class CheckTaskProjects {
  int id;
  String checkId;
  String areaId;
  String deviceId;
  int projectId;
  String projectName;
  String projectContext;
  int projectStatus;
  int projectQuestionStatus;

  CheckTaskProjects(
      {this.id,
        this.checkId,
        this.areaId,
        this.deviceId,
        this.projectId,
        this.projectName,
        this.projectContext,
        this.projectStatus,
        this.projectQuestionStatus});

  CheckTaskProjects.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    checkId = json['checkId'];
    areaId = json['areaId'];
    deviceId = json['deviceId'];
    projectId = json['projectId'];
    projectName = json['projectName'];
    projectContext = json['projectContext'];
    projectStatus = json['projectStatus'];
    projectQuestionStatus = json['projectQuestionStatus'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['checkId'] = this.checkId;
    data['areaId'] = this.areaId;
    data['deviceId'] = this.deviceId;
    data['projectId'] = this.projectId;
    data['projectName'] = this.projectName;
    data['projectContext'] = this.projectContext;
    data['projectStatus'] = this.projectStatus;
    data['projectQuestionStatus'] = this.projectQuestionStatus;
    return data;
  }
}